package com.hh.service.dao.merchant;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hh.common.model.merchant.Merchant;
import com.hh.common.response.merchant.MerchantListResponse;
import com.hh.common.vo.merchant.MerAppIdInfoVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface MerchantDao extends BaseMapper<Merchant> {
    @Select("select mer_app_id,mer_app_secret from eb_merchant where id = #{merId}")
    MerAppIdInfoVo getMerAppIdById(@Param("merId") String merId);

    @Select("select a.*,b.account from eb_merchant as a left join eb_merchant_admin as b on a.id = b.mer_id order by a.id desc")
    List<MerchantListResponse> getList();
}
